package com.paiai.lslease.dao.apphouse;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.paiai.lslease.model.AppInvitationInfo;
import com.paiai.lslease.model.HouseLockQuery;
import com.paiai.lslease.model.LockExternal;

import java.sql.SQLException;
import java.util.List;

public class AppHouseDiyDAOImpl implements AppHouseDiyDAO {

    private SqlMapClient sqlMapClient;

    public AppHouseDiyDAOImpl(SqlMapClient sqlMapClient) {
        super();
        this.sqlMapClient = sqlMapClient;
    }

    public int getNeweastAppHouseId() throws SQLException {
        return (Integer)sqlMapClient.queryForObject("app_house_info.selectNeweastHouseId");
    }

    public int getNeweastAppFurnitureId() throws SQLException {
        return (Integer)sqlMapClient.queryForObject("app_house_info.selectNeweastAppFurnitureId");
    }

    public int getNeweastAppPicId() throws SQLException {
        return (Integer)sqlMapClient.queryForObject("app_house_info.selectNeweastAppPicId");
    }

    @Override
    public List<AppInvitationInfo> selectRentingInvitationListByMobile(String userMobile) throws SQLException {
        return sqlMapClient.queryForList("app_house_info.selectRentingInvitationListByMobile", userMobile);
    }

    @Override
    public List<LockExternal> selectLockTenantList(HouseLockQuery houseLockQuery) throws SQLException {
        return sqlMapClient.queryForList("app_house_info.selectLockTenantListByTenantId", houseLockQuery);
    }
}
